/*    */ package com.cr.web.controller.monitor;
/*    */ 
/*    */ import com.cr.common.core.controller.BaseController;
/*    */ import com.cr.common.core.domain.AjaxResult;
/*    */ import com.cr.framework.web.service.CacheService;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.stereotype.Controller;
/*    */ import org.springframework.ui.ModelMap;
/*    */ import org.springframework.web.bind.annotation.GetMapping;
/*    */ import org.springframework.web.bind.annotation.PostMapping;
/*    */ import org.springframework.web.bind.annotation.RequestMapping;
/*    */ import org.springframework.web.bind.annotation.ResponseBody;
/*    */ 
/*    */ @Controller
/*    */ @RequestMapping({"/monitor/cache"})
/*    */ public class CacheController extends BaseController {
/* 23 */   private String prefix = "monitor/cache";
/*    */   
/*    */   @Autowired
/*    */   private CacheService cacheService;
/*    */   
/*    */   @GetMapping
/*    */   public String cache(ModelMap mmap) {
/* 31 */     mmap.put("cacheNames", this.cacheService.getCacheNames());
/* 32 */     return this.prefix + "/cache";
/*    */   }
/*    */   
/*    */   @PostMapping({"/getNames"})
/*    */   public String getCacheNames(String fragment, ModelMap mmap) {
/* 38 */     mmap.put("cacheNames", this.cacheService.getCacheNames());
/* 39 */     return this.prefix + "/cache::" + fragment;
/*    */   }
/*    */   
/*    */   @PostMapping({"/getKeys"})
/*    */   public String getCacheKeys(String fragment, String cacheName, ModelMap mmap) {
/* 45 */     mmap.put("cacheName", cacheName);
/* 46 */     mmap.put("cacheKyes", this.cacheService.getCacheKeys(cacheName));
/* 47 */     return this.prefix + "/cache::" + fragment;
/*    */   }
/*    */   
/*    */   @PostMapping({"/getValue"})
/*    */   public String getCacheValue(String fragment, String cacheName, String cacheKey, ModelMap mmap) {
/* 53 */     mmap.put("cacheName", cacheName);
/* 54 */     mmap.put("cacheKey", cacheKey);
/* 55 */     mmap.put("cacheValue", this.cacheService.getCacheValue(cacheName, cacheKey));
/* 56 */     return this.prefix + "/cache::" + fragment;
/*    */   }
/*    */   
/*    */   @PostMapping({"/clearCacheName"})
/*    */   @ResponseBody
/*    */   public AjaxResult clearCacheName(String cacheName, ModelMap mmap) {
/* 63 */     this.cacheService.clearCacheName(cacheName);
/* 64 */     return AjaxResult.success();
/*    */   }
/*    */   
/*    */   @PostMapping({"/clearCacheKey"})
/*    */   @ResponseBody
/*    */   public AjaxResult clearCacheKey(String cacheName, String cacheKey, ModelMap mmap) {
/* 71 */     this.cacheService.clearCacheKey(cacheName, cacheKey);
/* 72 */     return AjaxResult.success();
/*    */   }
/*    */   
/*    */   @GetMapping({"/clearAll"})
/*    */   @ResponseBody
/*    */   public AjaxResult clearAll(ModelMap mmap) {
/* 79 */     this.cacheService.clearAll();
/* 80 */     return AjaxResult.success();
/*    */   }
/*    */ }


/* Location:              D:\tmp\creditorRights-admin\BOOT-INF\classes\com.zip!\com\cr\web\controller\monitor\CacheController.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */